package com.mingxun.project.http.observer;

import com.mingxun.project.base.BaseView;

import io.reactivex.disposables.Disposable;

/**
 * class name：
 *
 * @author liuhongyuan.
 * @date 2017/12/20
 */

public abstract class HttpRxObserver<T> extends BaseRxObserver<T>{

    private BaseView mView;
    private boolean isShowProgress = true;

    public HttpRxObserver(BaseView view, boolean showProgress) {
        super(view);
        mView = view;
        this.isShowProgress = showProgress;
    }

    @Override
    public void onSubscribe(Disposable d) {
        if (mView != null && isShowProgress) {
//            mView.showDialog("数据加载中...");
//            mView.onLoadingView(LoadingUtils.STATE_LOADING);
        }
    }

    @Override
    public void onComplete() {
        if (mView != null && isShowProgress) {
//            mView.hideDialog();
//            mView.showToast("数据加载完成");
//            mView.onLoadingView(LoadingUtils.STATE_SUCCEED);
        }
    }
}
